package com.yiqi.zhiyuan.feature.mine.model;

import com.suozhang.framework.component.http.RxDataProcessFactory;
import com.yiqi.zhiyuan.entity.vo.DiverCenterVO;
import com.yiqi.zhiyuan.feature.mine.contract.MineContract;
import com.yiqi.zhiyuan.feature.mine.dependencies.mine.DaggerMineModelComponent;
import com.yiqi.zhiyuan.framework.api.ApiLib;
import com.yiqi.zhiyuan.framework.api.UserApi;

import javax.inject.Inject;

import io.reactivex.Observable;

/**
 * @ProjectName: ZhiYuan
 * @Description: 注册model
 * @Author: lijuwen
 * @CreateDate: 2019/3/13 13:07
 * @UpdateUser: 更新者
 * @UpdateDate: 2019/3/13 13:07
 * @UpdateRemark: 更新说明
 * @Version: 1.0
 */
public class MineModel implements MineContract.Model {
    @Inject
    UserApi api;

    public MineModel() {
        DaggerMineModelComponent.builder().apiComponent(ApiLib.apiComponent()).build().inject(this);
    }


    @Override
    public Observable<DiverCenterVO> doGetDiverCenter() {
        return api.driverCenter().compose(RxDataProcessFactory.<DiverCenterVO>dataPrepAndIoToMainTransformer());
    }
}

